<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第一题</title>
    <script src="../js/jquery-3.1.1.min.js"></script>
    <script>
        // window.onload = function (){
        //     document.getElementById("but2").onclick = function (){
        //         alert("Hello World in script block.");
        //     }
        // }

        $(function (){
            document.getElementById("but2").onclick = function (){
                alert("Hello World in script block.");
            }
        });
    </script>
    <script src="../js/demo2.js"></script>
</head>
<body>
    <h1>1. hello world</h1>
    <input type="button" id="but1" value="first button" onclick="alert('Hello World.')">
    <input type="button" id="but2" value="first button">
    <input type="button" id="but3" value="first button">
</body>
</html>